package com.kudian.restful.controller;

import com.kudian.restful.service.AppVersionService;
import com.kudian.restful.service.LoginSessionService;
import com.kudian.restful.service.WelInfoService;
import com.kudian.restful.vo.appversion.AppVersionRetVO;
import com.kudian.restful.vo.appversion.AppVersionVO;
import com.kudian.restful.vo.welinfo.WelInfoPageRetVO;
import com.wordnik.swagger.annotations.ApiOperation;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * Created by Administrator on 2016/4/27.
 */
@RestController
@RequestMapping("welinfo")
public class WelInfoController {

    private static final Logger logger = Logger.getLogger(WelInfoController.class);

    @Autowired
    private WelInfoService welInfoService;

    @Autowired
    private LoginSessionService loginSessionService;

    @RequestMapping(value = "query", method = RequestMethod.GET)
    @ApiOperation(value = "取得欢迎画面", httpMethod = "GET", notes = "取得欢迎画面", response = WelInfoPageRetVO.class)
    public @ResponseBody WelInfoPageRetVO query() {
        WelInfoPageRetVO o = new WelInfoPageRetVO();

        try {
            o = welInfoService.welcomepage();
            o.setErrcode(0);
            o.setErrmsg("成功取得欢迎画面");
        } catch (Exception e) {
            o.setErrcode(9999);
            o.setErrmsg("取得欢迎画面失败");
            logger.error(e);
        }
        return o;
    }

}
